import type { AxiosRequestConfig, AxiosResponse, InternalAxiosRequestConfig } from 'axios'

export interface SuperRequestConfig<T = any> extends AxiosRequestConfig {
  interceptors?: SuperRequestInterceptors<T>
  showLoading?: boolean
  needToken?: boolean
}

export interface SuperRequestInterceptors<T = any> {
  requestInterceptor?: (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig
  responseInterceptor?: (res: AxiosResponse<T>) => AxiosResponse<T> | Promise<AxiosResponse<T>>
  requestInterceptorCatch?: (err: any) => any
  responseInterceptorCatch?: (err: any) => any
}
